home *** CD-ROM | disk | FTP | other *** search
/ Java for 3D & VRML Worlds / Java for 3d and VRML Worlds.iso / doc / homepage / tutorials / lesson2 / conemove.wrl < prev    next >
Text File  |  1996-08-26  |  1KB  |  57 lines

  1. #VRML V2.0 utf8
  2.  
  3. Viewpoint {
  4.    position 0 3 8
  5. }
  6.  
  7. DEF CONE_TRANS Transform {
  8.   translation 0 3 0
  9.   children [
  10.     DEF TOUCH_SENSOR TouchSensor {}
  11.     Shape {
  12.       appearance Appearance {
  13.         material Material {
  14.           emissiveColor 0.5 0.5 0.5
  15.         }
  16.       }
  17.       geometry Cone { height 2 bottomRadius 1 }
  18.     }
  19.   ]
  20. }
  21.  
  22. Transform {
  23.   children [
  24.     Shape {
  25.       appearance Appearance {
  26.         material Material {
  27.           emissiveColor 0.4 0.0 1.0
  28.         }
  29.       }
  30.       geometry IndexedFaceSet {
  31.         coord Coordinate3 {
  32.           point [
  33.             10 0 10,
  34.             10 0 -10,
  35.             -10 0 -10,
  36.             -10 0 10
  37.           ]
  38.         }
  39.         coordIndex [
  40.           0, 1, 2, 3, -1
  41.         ]
  42.       }
  43.     }
  44.   ]
  45. }
  46.  
  47. DEF CONE_SCRIPT Script {
  48.   url "conemove.class"
  49.   scriptType "javabc"
  50.   field SFNode the_cone_trans USE CONE_TRANS
  51.   eventOut SFRotation theRot
  52.   eventIn SFBool clicked
  53. }
  54.  
  55. ROUTE TOUCH_SENSOR.isActive TO CONE_SCRIPT.clicked
  56. ROUTE CONE_SCRIPT.theRot TO CONE_TRANS.set_rotation
  57.